import os

import pandas as pd

from Utils import DirUtil


def arr2csv():
    pass
def dict2csv(filePath:str,dictt:dict,columns=None):
    df = pd.DataFrame(dictt,columns=columns)
    df.to_csv(filePath)

if __name__ == '__main__':
    pass
    desktopDir = DirUtil.getDesktopDir()
    filePath = os.path.join(desktopDir,"sort.csv")
    print("yzlog filePath:", filePath)

    # nme = ["Google", "Runoob", "Taobao", "Wiki2"]
    # st = ["www.google.com", "www.runoob.com", "www.taobao.com", "www.wikipedia.org"]
    # ag = [90, 40, 80, 98]
    # # 字典
    # dictt = {'name': nme, 'site': st, 'age': ag}
    # dict2csv(filePath=filePath,dictt=dictt)

    dict2csv(filePath=filePath,dictt=[['Google',10],['Runoob',12],['Wiki',13]],columns=['aa',22])